import { PropsWithChildren, useEffect } from "react";
import { useNavigate } from "react-router";

interface IRedirectProps {
  to?: string;
}
export function Redirect(props: PropsWithChildren<IRedirectProps>) {
  const { to } = props;
  const nav = useNavigate();
  useEffect(() => {
    nav(to);
  }, []);
  return null;
}
